<!DOCTYPE html>
<!--[if IE 9 ]><html class="ie9"><![endif]-->
    <head>
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
        <meta name="format-detection" content="telephone=no">
        <meta charset="UTF-8">

        <meta name="description" content="Violate Responsive Admin Template">
        <meta name="keywords" content="Super Admin, Admin, Template, Bootstrap">

        <title>三跨点管理</title>
            
        <!-- CSS -->
        <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
        <link href="css/animate.min.css" rel="stylesheet">
        <link rel="stylesheet" type="text/css" href="css/font-awesome.min.css">
        <link href="css/form.css" rel="stylesheet">
        <link href="css/calendar.css" rel="stylesheet">
        <link href="css/media-player.css" rel="stylesheet">
        <link href="css/style.css" rel="stylesheet">
        <link href="css/icons.css" rel="stylesheet">
        <link href="css/generics.css" rel="stylesheet"> 
        <link href="css/menu.css" rel="stylesheet">
        <!--<link rel="stylesheet" type="text/css" href="http://www.jq22.com/jquery/bootstrap-3.3.4.css">-->
    
        <style type="text/css">
        	#SanKua td  #play2 th #play3 th{
        		display: inline-block;
        		height: 50px;
        		width: 120px;
        	}
        	input{
        		color: black;
        		background-color: gainsboro;
        		border-radius: 5px;
        		font-family: "微软雅黑";
        		/*font-weight: bold;*/
        		opacity: 0.8;
        		border-color: forestgreen;
        		width: 90%;
        	}
        	input:hover{
        		background-color: wheat;
        		cursor:pointer;
        	}
        	.HIDEEdit:hover{
        		cursor:pointer;
        		color:orange;
        	}
        	.HIGHDelete:hover{
        		cursor: pointer;
        		color: orange;
        	}
        	#gt{
        		color: black;
        		margin: 10px;
        	}
        	#EditHIGH{
				position: absolute;
				left: 38%;
				font-family:"微软雅黑" ;
				font-size: 25px;
				color: orange;
				border-radius:5px;
				
			}
        	
        	
        </style>
    </head>
    <body id="skin-blur-blue">
        <header id="header" class="media">
            <a href="" id="menu-toggle"></a> 
            <a class="logo pull-left" href="asset_management.html">电力管理系统</a>
            
            <div class="media-body">
                <div class="media" id="top-menu">
                    <div class="pull-left tm-icon">
                        <a data-drawer="messages" class="drawer-toggle" href="">
                            <i class="sa-top-message"></i>
                            <i class="n-count animated"></i>
                            <span>实时消息</span>
                        </a>
                    </div>
                    <div class="pull-left tm-icon">
                        <a data-drawer="notifications" class="drawer-toggle" href="">
                            <i class="sa-top-updates"></i>
                            <i class="n-count animated"></i>
                            <span>告警信息</span>
                        </a>
                    </div>
                    
                    

                    <div id="time" class="pull-right">
                        <span id="hours"></span>
                        :
                        <span id="min"></span>
                        :
                        <span id="sec"></span>
                    </div>

                    <div class="media-body">
                        <input type="text" class="main-search">
                    </div>
                </div>
            </div>
        </header>
        
        
        
        
        
        <div class="clearfix"></div>
        
        <section id="main" class="p-relative" role="main">

            <!-- Sidebar -->
            <aside id="sidebar">

                <ul class="list-unstyled side-menu" style="width: 100%!important;padding-top: 20px;text-align: center;line-height: 40px;">
                    
                    <!--<li>
                        <a  href="keyInfo.html"  id='menuurl'>
                            <i class="fa fa-bar-chart-o"></i><span> 文件上传</span>
                        </a>
                    </li>
                    <li>
                        <a href="mstp_map.html" id='menuurl'>
                            <i class="fa fa-bar-chart-o"></i><span> 全息图概览</span>
                        </a>
                    </li>-->
                     <li >
                        <a href="asset_management.html"  id='menuurl'>
                            <i class="fa fa-building-o"></i><span> 资产管理</span>
                        </a>
                    </li>
                    <li>
                        <a href="trajectory.html"  id='menuurl'>
                            <i class="fa fa-sort-amount-asc"></i><span> 历史轨迹</span>
                        </a>
                    </li>
                    <li class="active">
                        <a href="Three_span_point.html" id='menuurl'>
                            <i class="fa fa-calendar-o"></i><span> 三跨点管理</span>
                        </a>
                    </li>
                    <li >
                        <a href="ice.html"  id='menuurl'>
                            <i class="fa  fa-money"></i><span> 隐患点管理</span>
                        </a>
                    </li>
                     <li>
                        <a href="fire.html" id='menuurl'>
                            <i class="fa fa-calendar-o"></i><span> 山火点管理</span>
                        </a>
                    </li>
                    <!--<li>
                        <a href="deviceManager.html"  id='menuurl'>
                            <i class="fa fa-briefcase"></i><span> 设备管理</span>
                        </a>
                    </li>-->
                   
                    <li >
                        <a href="userMng.html" id='menuurl'>
                            <i class="fa fa-users"></i><span> 用户管理</span>
                        </a>
                    </li>
                    <li   >
                        <a href="fileupdata.html" id='menuurl'>
                            <i class="fa fa-cogs"></i><span > 文件管理</span>
                        </a>
                    </li>
                </ul>
                

            </aside>
        
            <!-- Content -->
            <section id="content" class="container">
                <!-- Messages Drawer -->
               
               

                 <!--Breadcrumb--> 
                <ol class="breadcrumb hidden-xs">
                    <li><a href="index.html">主页</a></li>
                    <li><a href="#">管理</a></li>
                    <li class="active">三跨点管理</li>
                </ol>
                
                <h4 class="page-title">三跨点</h4>
               
				<div class="block-area" id="defaultStyle" style="display: inline-block;">
					<div class="row" >
						<div class="col-md-12" style="display: inline-block;">
							<div class="tile" style="width:100%;">
								<h2 class="tile-title">三跨点管理</h2>
								<table class="table tile" id="SanKua">
									<thead>
										
										<tr id="play2">
											<th>所属单位</th>
											<th>公司所在省</th>
											<th>高速公路名称</th>
											<th>高速公路建设状态</th>
											<th>穿越点线路名称</th>
											<th>电压等级</th>
											<th>建设状态</th>
											<th>投运时间</th>
											<th>建设时序</th>
											<th>穿越方式</th>
											<th>跨越水平距离</th>
											<th>垂直跨越距离</th>
											<th>交叉角度</th>
											<!--<th>是否为独立耐张段</th>-->
											<th>跨越耐张段长度</th>
											<th>耐张段内塔数量</th>
											<th>跨公路杆塔塔号</th>
											<th>加强措施</th>
											<th>导、地线有无接头</th>
											<th>两侧绝缘子串类型</th>
											<th>在线监测</th>
											<th style="width: 100px;!important">备注</th>
											<th>修改</th>
											<th>删除</th>
											

										</tr>
									</thead>
									<tbody id="sankua">
										
									</tbody>
								</table>
								
				
							</div>
						</div>
				
					
					
					
						
					</div>
				</div>                    
                   
                   
                
   
            </section>
            
            <br/><br/>
        </section>
        
        <!-- Javascript Libraries -->
        <!-- jQuery -->
        <script src="js/jquery-3-2-1.js"></script> <!-- jQuery Library -->
        
        <!-- Bootstrap -->
        <script src="js/bootstrap.js"></script>
       
        <script src="js/jquery.dataTables.min.js" type="text/javascript" charset="utf-8"></script>
        <script src="js/jquery.dataTables.bootstrap.js" type="text/javascript" charset="utf-8"></script>
        <!--Media Player-->
        <script src="js/media-player.min.js"></script> <!-- USA Map for jVectorMap -->
        <!-- UX -->
        <script src="js/scroll.min.js"></script> <!-- Custom Scrollbar -->
        
        <!-- Other -->
        <script src="js/calendar.min.js"></script> <!-- Calendar -->
        
         <script src="js/Tabullet.js"></script>
        <!-- All JS functions -->
        <!--<script src="js/functions.js"></script>-->
        <script src="js/Tabullet.js" type="text/javascript" charset="utf-8"></script>
        <script src="layer-v3.1.0/layer/layer.js" type="text/javascript" charset="utf-8"></script>
        
    	<script src="js/urlConfig.js" type="text/javascript" charset="utf-8"></script>
        
       <script type="text/javascript">
//     	var url ='http://117.27.139.39:4322/'
		
       	$.ajax({
//				url: 'http://192.168.1.41:1337/highSpeedLine',
				url: url + 'highSpeedLine', //url: url + 'linePoles/' + 504,
				//data: "127605d5-ee91-4557-a7fe-fb096918b6bc",
				type: 'get',
				dataType: 'json',
				success: function(data) {
					console.log('获取隐患点信息成功');
					console.log(data.data)
		        	console.log(data.data.name)
					var js = JSON.parse(data.data);
					console.log(js.length);
					console.log(js)
					var trend = '';
					for(var i = 0; i < js.length; i++) {
						var js = JSON.parse(data.data);
						var HIDE=js[i]
						var Distance = js[i].distance * 1
						
						
						
						trend += '<tr>'
			            trend += '<td>' + HIDE.unitName+ '</td>'
						trend += '<td>' + HIDE.provinceCompany+ '</td>'
						trend += '<td>' + HIDE.highSpeedName+ '</td>'
						trend += '<td>' + HIDE.highSpeedStatus+ ' </td>'
						trend += '<td>' + HIDE.acrossLineName+ ' </td>'
						trend += '<td>' + HIDE.highPressureLevel+ ' </td>'
						trend += '<td>' + HIDE.makelineStatus+ ' </td>'
						trend += '<td>' + HIDE.startTime+ '</td>'
						trend += '<td>' + HIDE.makeLineOrd+ '</td>'
						trend += '<td>' + HIDE.accrossType+ ' </td>'
						trend += '<td>' + HIDE.levelLong+ ' </td>'
						trend += '<td>' + HIDE.verticalLong+ ' </td>'
						trend += '<td>' + HIDE.CrossAngle+ ' </td>'
//						trend += '<td>' + HIDE.IndependentOrNot+ '</td>'
						trend += '<td>' + HIDE.IndependentLong+ ' </td>'
						trend += '<td>' + HIDE.IndependentNum+ ' </td>'
						trend += '<td>' + HIDE.PolesOrder+ ' </td>'
						trend += '<td>' + HIDE.measure+ ' </td>'
						trend += '<td>' + HIDE.wireGroundingOrNot+ '</td>'
						trend += '<td>' + HIDE.insulatorType+ '</td>'
						trend += '<td>' + HIDE.onLineControlOrNot+ ' </td>'
						trend += '<td>' + HIDE.countyCompanyAssets+ '</td>'
						trend += '<td class="HIDEEdit" id="' + HIDE.id+"_____"+ '">修改</td>'
						trend += '<td class="HIGHDelete" id="' + HIDE.id+ '">删除</td>'
						
						
						trend += '</tr>'
						
						
					}
					$('#sankua').html(trend);
					form_paging();
					
				$(document.body).on('click',".HIDEEdit",function(event){
				var high_id=$(this).attr("id").replace('_____','');
				var parent1 = window.parent.document.getElementById(''+high_id+'').parentNode;
				var high_unitName=parent1.children[0].textContent;
				var high_provinceCompany=parent1.children[1].textContent;
				
				var high_highSpeedName=parent1.children[2].textContent;
				var high_highSpeedStatus=parent1.children[3].textContent;
				var high_acrossLineName=parent1.children[4].textContent;
				var high_highPressureLevel=parent1.children[5].textContent;
				var high_makelineStatus=parent1.children[6].textContent;
				var high_startTime=parent1.children[7].textContent;
				var high_makeLineOrd=parent1.children[8].textContent;
				var high_accrossType=parent1.children[9].textContent;
				var high_levelLong=parent1.children[10].textContent;
				var high_verticalLong=parent1.children[11].textContent;
				var high_CrossAngle=parent1.children[12].textContent;
//				var high_IndependentOrNot=parent1.children[13].textContent;
				var high_IndependentLong=parent1.children[13].textContent;
				var high_IndependentNum=parent1.children[14].textContent;
				var high_PolesOrder=parent1.children[15].textContent;
				var high_measure=parent1.children[16].textContent;
				var high_wireGroundingOrNot=parent1.children[17].textContent;
				var high_insulatorType=parent1.children[18].textContent;
				var high_onLineControlOrNot=parent1.children[19].textContent;
				var high_countyCompanyAssets=parent1.children[20].textContent;
//				var high_ids=parent1.children[22].textContent;
						layer.open({
							type: 1,
							area: ['720px', '720px'],
							shadeClose: true, //点击遮罩关闭
							content: '<div id="gt">' +
								'<div class="container">' +
								'<div class="poleShow">' +
								'<button type="submit" id="EditHIGH">修改三跨点信息</button><br>' +
								'<label for="">线路所属单位：</label><input type="text" id="TZ1" placeholder="可修改" value=' + high_unitName + ' />' +
								'<label for="">公司所在省：</label><input type="text"  id="TZ2" placeholder="可修改" value=' + high_provinceCompany + ' />' +
								
								'<label for="">高速公路名称：</label><input type="text" id="TZ3" placeholder="可修改" value=' + high_highSpeedName + ' />' +
								'<label for="">高速公路建设状态：</label><input type="text" id="TZ4" placeholder="可修改" value=' + high_highSpeedStatus + ' />' +
								'<label for="">穿越点线路名称：</label><input type="text"  id="TZ5" placeholder="可修改" value=' + high_acrossLineName+ ' />' +
								'<label for="">路线电压等级：</label><input type="text"  id="TZ6" placeholder="可修改" value=' + high_highPressureLevel + ' />' +
								'<label for="">线路建设状态：</label><input type="text"  id="TZ7" placeholder="可修改" value=' + high_makelineStatus + ' />' +
								'<label for="">线路投运时间：</label><input type="text"  id="TZ8" placeholder="可修改" value=' + high_startTime + ' />' +
								'<label for="">线路建设时序：</label><input type="text"  id="TZ9" placeholder="可修改" value=' + high_makeLineOrd + ' />' +
								'<label for="">线路穿越方式：</label><input type="text"  id="TZ10" placeholder="可修改" value=' + high_accrossType + ' />' +
								'<label for="">跨越水平距离：</label><input type="text"  id="TZ11" placeholder="可修改" value=' + high_levelLong + ' />' +
								'<label for="">垂直跨越距离：</label><input type="text"  id="TZ12" placeholder="可修改" value=' + high_verticalLong + ' />' +
								'<label for="">线路交叉角度：</label><input type="text"  id="TZ13" placeholder="可修改" value=' + high_CrossAngle + ' />' +
//								'<label for="">是否为独立耐张段：</label><input type="text"  id="TZ14" placeholder="可修改" value=' + high_IndependentOrNot + ' />' +
								'<label for="">跨越耐张段长度：</label><input type="text"  id="TZ15" placeholder="可修改" value=' + high_IndependentLong+ ' />' +
								'<label for="">耐张段内直线塔数量：</label><input type="text"  id="TZ16" placeholder="可修改" value=' + high_IndependentNum + ' />' +
								'<label for="">跨越公路两侧杆塔塔号：</label><input type="text"  id="TZ17" placeholder="可修改" value=' + high_PolesOrder + ' />' +
								'<label for="">铁塔采取了何种加强措施：</label><input type="text"  id="TZ18" placeholder="可修改" value=' + high_measure + ' />' +
								'<label for="">导、地线有无接头：</label><input type="text"  id="TZ19" placeholder="可修改" value=' + high_wireGroundingOrNot + ' />' +
								'<label for="">两侧绝缘子串类型：</label><input type="text"  id="TZ20" placeholder="可修改" value=' + high_insulatorType + ' />' +
								'<label for="">是否安装了在线监测：</label><input type="text"  id="TZ21" placeholder="可修改" value=' + high_onLineControlOrNot + ' />' +
								
								'<label for="">县公司资产核对备注：</label><input type="text"  id="TZ23" placeholder="可修改" value=' + high_countyCompanyAssets + ' />' +
								'<label for="">ID：(切勿修改)</label><input type="text"  id="TZ22" placeholder="可修改" value=' + high_id + ' />' +
								'</div>' +

								'</div>' +
								'</div>'
						});
								
					});
					
					console.log("66666666666666666666666666666")
					// 阻止表单的默认提交事件
					
				//	发送数据到后端
				
				$(document.body).on('click',"#EditHIGH",function(event){
					 $.ajax({
				        type: "put",
				        url:url+'highSpeedLine',
				        dataType: 'json',
				        data: {
				      	"id": $("#TZ22").val(),
//					    "name": $("#inputName").val(),
						"unitName":$("#TZ1").val(),
						"provinceCompany":$("#TZ2").val(),
						"highSpeedName":$("#TZ3").val(),
						"highSpeedStatus":$("#TZ4").val(),
						"acrossLineName":$("#TZ5").val(),
						"highPressureLevel":$("#TZ6").val(),
						"makelineStatus":$("#TZ7").val(),
						"startTime":$("#TZ8").val(),
						"makeLineOrd":$("#TZ9").val(),
						"accrossType":$("#TZ10").val(),
						"levelLong":$("#TZ11").val(),
						"verticalLong":$("#TZ12").val(),
						"CrossAngle":$("#TZ13").val(),
//						"IndependentOrNot":$("#TZ14").val(),
						"IndependentLong":$("#TZ15").val(),
						"IndependentNum":$("#TZ16").val(),
						"PolesOrder":$("#TZ17").val(),
						"measure":$("#TZ18").val(),
						"wireGroundingOrNot":$("#TZ19").val(),
						"insulatorType":$("#TZ20").val(),
						"onLineControlOrNot":$("#TZ21").val(),
						"countyCompanyAssets":$("#TZ23").val()
						
				},
				        success: function (data, status) { 
				        	console.log(data)
				        	console.log(status)
				        	console.log(data.message)
				        	
				        	if(data.errorCode == 1){
				        		layer.msg("修改跨高速数据成功!");
				        		setTimeout( function(){
							    layer.load(0, {shade: false}); //0代表加载的风格，支持0-2
							    
								}, 2000);//延迟1500毫米
								layer.closeAll('loading'); //关闭加载层
				        		setTimeout( function(){
								    
//									layer.closeAll('loading'); //关闭加载层	
								    parent.location.reload()
								}, 3000);//延迟1500毫米
				        	}else if(data.errorCode == 0){
				        		layer.msg("修改跨高速数据失败请检查信息格式是否准确！");
				        	}
				        	
				        }
				    });
				  
				 });    
					
				}//获取路线结束
			});//ajax结束
			
			$(document.body).on('click',".HIGHDelete",function(){
					var result=confirm('你确定要删除么？')
					
					console.log(this.id)
					if(result){
						
//							console.log($(this.parent))
							$.ajax({
					        type: "delete",
					        url:url+'highSpeedLine',
					        dataType: 'json',
					        data: {
						    	"id": this.id
						    	
							},
					        success: function (data, status) { 
					        	
					        	if(data.errorCode == 1){
				        		layer.msg(data.message);
				        		
										
								setTimeout( function(){
							    layer.load(0, {shade: false}); //0代表加载的风格，支持0-2
							    
								}, 2000);//延迟1500毫米
								layer.closeAll('loading'); //关闭加载层
				        		setTimeout( function(){
								    
//									layer.closeAll('loading'); //关闭加载层	
								    parent.location.reload()
								}, 3000);//延迟1500毫米
				        	}
					        	
					    		}
							})
					}
				})
			
			
				
//			 $(document).ready(function(){
//	        $('#play').DataTable();
//	    });
			
			function form_paging() {
			var table = $('#SanKua').dataTable({
				"aaSorting": [], //默认第几个排序
				"bStateSave": false, //状态保存
				"bFilter": true,
				"aoColumnDefs": [
					//{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
					{
						"orderable": false,
						"aTargets": [0, 1, 2]
					} // 制定列不参与排序
				]
			});
		
			}
       </script>
    </body>
</html>

